From: Keir Fraser Date: Wed, 22 Oct 2008 10:53:51 +0000 (+0100) Subject: Simplify set_px_info hypercall 32-on-64 compatibility shim. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14054^2~60 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22?a=commitdiff_plain;h=87396a40955f5e7c2d479ad1e956328cc6a3fb06;p=xen.git Simplify set_px_info hypercall 32-on-64 compatibility shim. Mark processor_px as 'checking' and translate handle to simplify actual code doing in the translation. (According to Jan Beulich's suggestion) Signed-off-by: Liu, Jinsong --- diff --git a/xen/arch/x86/x86_64/cpufreq.c b/xen/arch/x86/x86_64/cpufreq.c index 1931eecfaf..d005dfdc6d 100644 --- a/xen/arch/x86/x86_64/cpufreq.c +++ b/xen/arch/x86/x86_64/cpufreq.c @@ -56,34 +56,13 @@ compat_set_px_pminfo(uint32_t cpu, struct compat_processor_performance *perf) return -EFAULT; #define XLAT_processor_performance_HNDL_states(_d_, _s_) do { \ - xen_processor_px_t *xen_states = NULL; \ -\ - if ( likely((_s_)->state_count > 0) ) \ - { \ - XEN_GUEST_HANDLE(compat_processor_px_t) states; \ - compat_processor_px_t state; \ - int i; \ -\ - xen_states = xlat_malloc_array(xlat_page_current, \ - xen_processor_px_t, (_s_)->state_count); \ - if ( unlikely(xen_states == NULL) ) \ - return -EFAULT; \ -\ - if ( unlikely(!compat_handle_okay((_s_)->states, \ - (_s_)->state_count)) ) \ - return -EFAULT; \ - guest_from_compat_handle(states, (_s_)->states); \ -\ - for ( i = 0; i < _s_->state_count; i++ ) \ - { \ - if ( unlikely(copy_from_guest_offset(&state, states, i, 1)) ) \ - return -EFAULT; \ - XLAT_processor_px(&xen_states[i], &state); \ - } \ - } \ -\ - set_xen_guest_handle((_d_)->states, xen_states); \ + XEN_GUEST_HANDLE(compat_processor_px_t) states; \ + if ( unlikely(!compat_handle_okay((_s_)->states, (_s_)->state_count)) ) \ + return -EFAULT; \ + guest_from_compat_handle(states, (_s_)->states); \ + (_d_)->states = guest_handle_cast(states, xen_processor_px_t); \ } while (0) + XLAT_processor_performance(xen_perf, perf); #undef XLAT_processor_performance_HNDL_states diff --git a/xen/include/xlat.lst b/xen/include/xlat.lst index c38dd39a9f..b10d215254 100644 --- a/xen/include/xlat.lst +++ b/xen/include/xlat.lst @@ -56,6 +56,6 @@ ! processor_flags platform.h ! processor_power platform.h ! pct_register platform.h -! processor_px platform.h +? processor_px platform.h ! psd_package platform.h ! processor_performance platform.h